public class VoltageAdapter implements FiveVolt {
    private EuropeanSocket socket; // 组合适配者对象

    public VoltageAdapter(EuropeanSocket socket) {
        this.socket = socket;
    }

    @Override
    public int getVolt5() {
        int volt220 = socket.getVolt220();
        return convert(volt220); // 电压转换逻辑
    }

    private int convert(int volt220) {
        return volt220 / 44; // 简化的转换逻辑（实际需电路设计）
    }
}
